<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1.0" />
  <title>class</title>
</head>

<body>
  <script src="./js/moduleDemo1.js" type="module"></script>
  <!-- <script>
           class People{
               constructor(name,age){
                   this.name=name;
                   this.age=age;
               }
               static immer(){
                   console.log("ddd")
               } 
               say () {
                   console.log("我会说话.......")
               }
           }

           let newPeople=new People("zhangsan","123");
            //静态属性   类名.static属性，静态方法
           console.log(newPeople,newPeople.say())
           People.immer();
           class Student extends People{
               constructor(name,age,yeay){
                   super(name,age)//手动调用父类构造函数
                   this.yeay=yeay
               }

               say () {
                   console.log(this.name)
               }
           }

           let newStudent=new Student("wdwd","234","222");
            //静态方法也可以继承下来
           console.log(newStudent)
           //Symbol  //独一无二的 不能同new调用有什么用  不能够进行加减乘除计算
           /*
              var obj={
                  a:1,
              }

              添加对象，不知道是否有相同覆盖,
              for in 遍历键名，Symbol不能够遍历到
              for  of是可以的
           */
           let s1=Symbol("a");
           let s2=Symbol("b");
           console.log(typeof s1);
           console.log(typeof s2);
           console.log(s1===s2);
           let obj={
               a:1,
               b:2
           }
        //   obj.a=3;
          let a=Symbol("a");
        //   obj[a]="4";
        //   obj["a"]="4";
        //   obj[a]="4";
        //   obj['c']="66"
        //   console.log(obj)
          //字符串

          let  str="bin";
          console.log(str.indexOf("e"));
          if(str.indexOf("i")!==-1){
              console.log("you")
          }else{
              console.log("没有")
          }

          if(str.includes("s")){
              console.log(str.includes("s"));
          }

          let htm=`<ul>
            <li>11111</li> 
            <li>22222</li> 
            <li>1133333111</li> 
            </ul>`
         console.log(htm);
         let  flag=6;
         let fn=() => 4+5
         console.log(`今天天气真好${flag>5?true:false}`)
         console.log(`今天天气真好${fn()}`)
         //创建数组
         let arrs=Array.of(10,20,30);
         console.log(arrs);
         console.log(Array.isArray(arrs));

         let arrs2=[10,30,40,50,80,60,90,100];
         //找到数组中,找到一个就停止啦
        // let num= arrs2.find(function(item){
        //      console.log(item);
        //      return item>50;
        //  })
        let inde=arrs2.findIndex(function(item){
             console.log(item);
             return item>60;
         })
         console.log("*********************")
        //  console.log(num)
         console.log(inde);

         //对象
         let obj2={
             name:"张三丰",
             age:12,
             say () {
                 console.log("我会说话.......")
             }
         }
         obj2.say();


         for(let objI of Object.keys(obj2)){
             console.log(objI)
         }

         for(let objI of Object.values(obj2)){
             console.log(objI)
         }

         for(let [index,item] of Object.entries(obj2)){
             console.log(index,"........"+item)
         }

         //对象键名是一个变量
         let swidth="width";  //对象不支持
         let obj3={
             [swidth]:100
         }
        console.log(obj3);


        let obj4={
            a:1,
            b:2,
            c:5
        }
        //覆盖原来的
        let obj5={
            ...obj4,
            c:3
        }
        console.log(obj5);

       let arrs6=[1,2,3,8,5,6];
       let max= Math.max(...arrs6)
       console.log(max)

       let arrs8=[1,2,3,4,5,6,7,32,1,2,3,4]
    //    let newArr8=new Set(arrs8)
       let newArr8=[...new Set(arrs8)]; //转换为数组
       console.log(newArr8);
        </script>   -->

  <!--模块申明，内部有用 defer延迟加载-->


</body>

</html>
